package com.smedi.ismedi.inmail.api.feign;

import com.smedi.ismedi.inmail.api.dto.request.appVersion.*;
import com.smedi.ismedi.inmail.api.dto.response.AppVersionResponse;
import com.smedi.ismedi.inmail.api.dto.response.CheckVersionResponse;
import com.smedi.ismedi.web.starter.common.PaginationData;
import com.smedi.ismedi.web.starter.common.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.validation.Valid;
import java.util.List;

/**
 * @version: v1.0.0
 * @author: wzx
 * @date: 2023/8/30 10:06
 * @Description: APP版本管理
 */

@FeignClient(name = "ismedi-inmail")
@Api(value = "APP版本管理", tags = {"APP版本管理"})
@RequestMapping(value = "/api/v1/app/version")
public interface RemoteAppVersionFeignApi {

    /**
     * 新增 发布
     *
     * @param appVersionCreateRequest 发布 新增 请求
     * @return ResponseData < Long>
     */
    @Operation(summary = "新增 APP版本", description = "新增 APP版本")
    @PostMapping(value = "/create")
    ResponseData<Long> create(@Valid @RequestBody AppVersionCreateRequest appVersionCreateRequest);

    /**
     * 更新 发布
     *
     * @param appVersionUpdateRequest 发布 更新 请求
     * @return ResponseData < Long>
     */
    @Operation(summary = "更新 APP版本", description = "更新 APP版本")
    @PostMapping(value = "/update")
    ResponseData<Long> update(@Valid @RequestBody AppVersionUpdateRequest appVersionUpdateRequest);

    /**
     * 删除 发布
     *
     * @param appVersionRemoveRequest 发布 删除 请求
     * @return ResponseData < Void>
     */
    @Operation(summary = "删除 APP版本", description = "删除 APP版本")
    @PostMapping(value = "/remove")
    ResponseData<Boolean> remove(@Valid @RequestBody AppVersionRemoveRequest appVersionRemoveRequest);

    /**
     * 启用 发布
     *
     * @param appVersionEnableRequest 发布 启用 请求
     * @return ResponseData < Void>
     */
    @Operation(summary = "启用 APP版本", description = "启用 APP版本")
    @PostMapping(value = "/enable")
    ResponseData<Boolean> enable(@Valid @RequestBody AppVersionEnableRequest appVersionEnableRequest);


    /**
     * 禁用 发布
     *
     * @param appVersionDisableRequest 发布 禁用 请求
     * @return ResponseData < Void>
     */
    @Operation(summary = "禁用 APP版本", description = "禁用 APP版本")
    @PostMapping(value = "/disable")
    ResponseData<Boolean> disable(@Valid @RequestBody AppVersionDisableRequest appVersionDisableRequest);

    /**
     * 获取 发布
     *
     * @param appVersionGetRequest 发布 获取 请求
     * @return ResponseData < AppVersionResponse>
     */
    @Operation(summary = "获取 APP版本", description = "获取 APP版本")
    @PostMapping(value = "/get")
    ResponseData<AppVersionResponse> get(@Valid @RequestBody AppVersionGetRequest appVersionGetRequest);

    /**
     * 列表 发布
     *
     * @param appVersionListRequest 发布 列表 请求
     * @return ResponseData < AppVersionResponse>
     */
    @Operation(summary = "列表 APP版本", description = "列表 APP版本")
    @PostMapping(value = "/list")
    ResponseData<List<AppVersionResponse>> list(@Valid @RequestBody AppVersionListRequest appVersionListRequest);

    /**
     * 分页 发布
     *
     * @param appVersionPageRequest 发布 分页 请求
     * @return ResponseData < AppVersionResponse>
     */
    @Operation(summary = "分页 APP版本", description = "分页 APP版本")
    @PostMapping(value = "/page")
    ResponseData<PaginationData<AppVersionResponse>> page(@Valid @RequestBody AppVersionPageRequest appVersionPageRequest);

    /**
     * 检查版本
     *
     * @param appVersionCheckVersionRequest 版本检查 请求
     * @return ResponseEntity<Response < Long>>
     */
    @Operation(summary = "检查版本", description = "检查版本")
    @PostMapping(value = "/check-version")
    ResponseData<CheckVersionResponse> checkVersion(@Valid @RequestBody AppVersionCheckVersionRequest appVersionCheckVersionRequest);

}
